package com.only4play.practice.ordercenter.core.entity;

import com.only4play.codegen.processor.api.*;
import com.only4play.codegen.processor.controller.GenController;
import com.only4play.codegen.processor.creator.GenCreator;
import com.only4play.codegen.processor.creator.IgnoreCreator;
import com.only4play.codegen.processor.dto.GenDto;
import com.only4play.codegen.processor.entitymapper.GenObjectMapper;
import com.only4play.codegen.processor.mapper.GenMapper;
import com.only4play.codegen.processor.query.GenQuery;
import com.only4play.codegen.processor.service.GenService;
import com.only4play.codegen.processor.service.GenServiceImpl;
import com.only4play.codegen.processor.updater.GenUpdater;
import com.only4play.codegen.processor.updater.IgnoreUpdater;
import com.only4play.codegen.processor.vo.GenVo;
import com.only4play.codegen.support.annotation.FieldDesc;
import com.only4play.codegen.support.constants.ValidStatus;
import com.only4play.codegen.support.model.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
//@GenCreator(pkgName = "com.only4play.practice.ordercenter.model.creator")
//@GenUpdater(pkgName = "com.only4play.practice.ordercenter.model.updater")
//// findById方法
//@GenVo(pkgName = "com.only4play.practice.ordercenter.model.vo")
//// findByPage方法
//@GenQuery(pkgName = "com.only4play.practice.ordercenter.model.query")
//@GenCreateRequest(pkgName = "com.only4play.practice.ordercenter.model.request")
//@GenUpdateRequest(pkgName = "com.only4play.practice.ordercenter.model.request")
//@GenQueryRequest(pkgName = "com.only4play.practice.ordercenter.model.request")
//@GenResponse(pkgName = "com.only4play.practice.ordercenter.model.response")
//@GenDto(pkgName = "com.only4play.practice.ordercenter.model.dto")
//
//@GenFeign(pkgName = "com.only4play.practice.ordercenter.model.feign")
//
//// 生成serviceImpl
//@GenObjectMapper(pkgName = "com.only4play.practice.ordercenter.entitymapper")
//// 生成serviceImpl
//@GenMapper(pkgName = "com.only4play.practice.ordercenter.core.mapper")
//@GenService(pkgName = "com.only4play.practice.ordercenter.core.service")
//@GenServiceImpl(pkgName = "com.only4play.practice.ordercenter.core.service.impl")
//
//@GenController(pkgName = "com.only4play.practice.ordercenter.core.controller")
@EqualsAndHashCode(callSuper = true)
@Data
public class ReviseRecord extends BaseEntity {

  @FieldDesc(name = "操作人")
  private String operateUser;

  @FieldDesc(name = "唯一流水")
  private Long flowNo;

  @FieldDesc(name = "修订前")
  private String reviseBefore;

  @FieldDesc(name = "修订后")
  private String reviseAfter;

  @FieldDesc(name = "差别")
  private String diff;

  @FieldDesc(name = "表名")
  private String tableName;

  @FieldDesc(name = "修订原因")
  private String reviseReason;

  @IgnoreUpdater
  @IgnoreCreator
  private ValidStatus validStatus;

  public void init() {
    setValidStatus(ValidStatus.VALID);
  }

  public void valid(){
    setValidStatus(ValidStatus.VALID);
  }

  public void invalid(){
    setValidStatus(ValidStatus.INVALID);
  }

}
